/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package baperjakat;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JOptionPane;

/**
 *
 * @author Marlon
 */
public class koneksi {
    
    private static Connection koneksi;
    
    public static Connection getKoneksi(){
       try {
            DriverManager.registerDriver(new com.mysql.jdbc.Driver());
            koneksi = DriverManager.getConnection("jdbc:mysql://localhost/dblogin","root","123456");
            } catch (SQLException e) {
                    JOptionPane.showMessageDialog(null,e.getMessage());
                    JOptionPane.showMessageDialog(null,e.getSQLState());
                    JOptionPane.showMessageDialog(null,e.getErrorCode());
         }
            return koneksi;
    
    }
}
